Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

has-to-string-tag-x

Package Overview
Dependencies
Maintainers
1
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

has-to-string-tag-x

Tests if ES6 @@toStringTag is supported.

  • 2.1.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.1M
decreased by-41.12%
Maintainers
1
Weekly downloads
 
Created

What is has-to-string-tag-x?

The has-to-string-tag-x npm package is a utility that checks if an object has the `@@toStringTag` property. This property is used to customize the default string description of an object.

What are has-to-string-tag-x's main functionalities?

Check if an object has a toStringTag property

This feature allows you to check if an object has the `@@toStringTag` property. In the example, the object `obj` has a custom `toStringTag` property, so the function returns `true`.

const hasToStringTag = require('has-to-string-tag-x');
const obj = { [Symbol.toStringTag]: 'Custom' };
console.log(hasToStringTag(obj)); // true

Check if an object does not have a toStringTag property

This feature allows you to check if an object does not have the `@@toStringTag` property. In the example, the object `obj` does not have a `toStringTag` property, so the function returns `false`.

const hasToStringTag = require('has-to-string-tag-x');
const obj = {};
console.log(hasToStringTag(obj)); // false

Other packages similar to has-to-string-tag-x

Keywords

FAQs

Package last updated on 28 Aug 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc